<template>
  <div class="limiter">
    <div class="container-login100">
      <div class="wrap-login100 p-l-55 p-r-55 p-t-65 p-b-54">
        <form class="login100-form validate-form">
          <span class="login100-form-title p-b-49">登录</span>

          <div
            class="wrap-input100 validate-input m-b-23"
            data-validate="请输入用户名"
          >
            <span class="label-input100" style="float: left">用户名</span>
            <input
              class="input100"
              type="text"
              placeholder="请输入用户名"
              autocomplete="off"
                v-model="name"
           
            />
            <span class="focus-input100"></span>
          </div>

          <div class="wrap-input100 validate-input" data-validate="请输入密码">
            <span class="label-input100" style="float: left">密码</span>
            <input
            
              class="input100"
              placeholder="请输入密码"
              v-model="password"
            />
            <span class="focus-input100"></span>
          </div>

          <div class="text-right p-t-8 p-b-31">
            <a href="javascript:">忘记密码？</a>
          </div>

          <div class="container-login100-form-btn">
            <div class="wrap-login100-form-btn">
              <div class="login100-form-bgbtn"></div>
             
                <button class="login100-form-btn" @click="goTo()">登 录</button>
            </div>
          </div>
          <div class="flex-col-c p-t-25">
            <button class="txt2" @click="go()">立即注册</button>
          </div>
        </form>
      </div>
    </div>
  </div>
</template>

<script>
import $ from "jquery";
import { loginAxios } from "../request/api";
import { getUserAxios } from "../request/api";
import qs from "qs"
export default {
  name: "login",
  created(){
     let json=""
    let thisa=this
    getUserAxios(json,thisa)
  },
  data() {
    return {
      name: "",
      password: "",
      method: "",
    };
  },
  methods: {
    goTo() {
      let thisa = this;
      let json = {
        "uname":String(this.name),
        "upassword":this.password
      }
      if (this.name == "" || this.password == "") {
        alert("请填写完整输入框");
      } else {

        loginAxios(json,thisa);
     
      }
    },
    go() {
      this.$router.push("/register");
    },
  },
};
</script>
<style scoped>
@import "./css/main.css";
@import "./css/util.css";
.container-login100 {
  background-image: url("../assets/bg-01.jpg") !important;
}
</style>
